<template>
  <div class="item-list">
   <Table border :columns="columns" :data="data"></Table>
   <Page :total="shequPageInfo.totalRecord" class="page_style" :current="shequPageInfo.pageNo"
                  :page-size="shequPageInfo.pageSize" @on-change="changeshequPageNo" show-total show-elevator show-sizer @on-page-size-change="changeshequsize"/>
  </div>
</template>

<script>
import { DepartmentalTimeliness } from '@/api/eventlist'

export default {
  name: 'newItemList',
  data () {
    return {
      shequPageInfo: { pageNo: 1, pageSize: 10, currentPageNo: 1, currentPageSize: 10, totalRecord: 0 },
      columns: [
        {
          title: '办件地点',
          key: 'jdjg'
        },
        {
          title: '办件量',
          key: 'zong'
        },
        {
          title: '成功超时',
          key: 'cheng'
        },
        {
          title: '失败超时',
          key: 'shi'
        }
      ],
      data: []
    }
  },
  mounted () {
    this.getList()
  },
  methods: {
    async getList (pageNo) {
      let para = {
        pageNo: pageNo,
        pageSize: this.shequPageInfo.pageSize
      }
      const res = await DepartmentalTimeliness(para)
      console.log(res, 'DepartmentalTimelinessDepartmentalTimeliness')
      if (res.data.errcode === 0) {
        this.data = res.data.data.results
        this.shequPageInfo.pageNo = res.data.data.pageNo
        this.shequPageInfo.totalRecord = res.data.data.totalRecord
      }
    },
    changeshequPageNo (pageNo) {
      this.shequPageInfo.pageNo = pageNo
      this.getList(pageNo)
    },
    changeshequsize (pageNo) {
      this.shequPageInfo.pageSize = pageNo
      this.changeshequPageNo()
    }
  }
}
</script>
<style lang="less" scoped>
.item-list{}
</style>
